package com.rrjjg.app.admin.data.storage.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.rrjjg.app.mybatis.bean.ConditionalType;
import com.rrjjg.app.mybatis.bean.MyBatisConditional;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 * 用户
 * </p>
 *
 * @author vayne
 * @since 2023-04-06
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName(value = "USER",autoResultMap = true)
@ApiModel(value = "User对象", description = "用户")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
      @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @MyBatisConditional(alias ="login_name" ,type = ConditionalType.EQ)
    @ApiModelProperty("登录名")
    @TableField("login_name")
    private String loginName;

    @MyBatisConditional(type = ConditionalType.EQ)
    @ApiModelProperty("密码")
    @TableField("password")
    private String password;

    @ApiModelProperty("角色")
    @TableField("role_id")
    private Long roleId;
}
